/*eslint-disable*/
import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

//创建router的工厂函数
//isDoubleBind - 是否同时绑定了手机号和微信
export function createRouter() {
  let router = new Router({
    mode: 'history',
    fallback: false,
    routes: [
      {
        //首页
        name: '标学教育',
        path: '/index',
        component: () => import('@/pages/index.vue')
      },
      {
        //重定向到首页
        path: '*',
        redirect: '/index'
      }
    ],
    scrollBehavior: () => ({
      y: 0
    })
  })

  // 在这里进行全局路由守卫的设置，进行登录验证
  router.beforeEach((to, from, next) => {
    next()
  })

  return router
}
